$(function(){
  var $width = $(document.body).width()
  var $height = $(document.body).height()
  var $right = ($width-1200)/2-80;
  $(".sidebar").css({"right": $right+"px"})
  /* window.onscroll = function () {
    if (document.documentElement.scrollTop + document.body.scrollTop > 100) {
      document.getElementById("top").style.display = "block";
    } else {
      document.getElementById("top").style.display = "none";
    }
  } */
  $(".kf").mouseover(function(){
    $(this).addClass("active");
    $(this).find("img").attr("src", "../assets/images/kefuhover.png")
  }).mouseout(function(){
    $(this).removeClass("active");
    $(this).find("img").attr("src", "../assets/images/kefu.png")
  })
  $(".top").mouseover(function(){
    $(this).addClass("active");
    $(this).find("img").attr("src", "../assets/images/tophover.png")
  }).mouseout(function(){
    $(this).removeClass("active");
    $(this).find("img").attr("src", "../assets/images/top.png")
  }).click(function(){
    document.body.scrollTop = document.documentElement.scrollTop = 0;
  })
})